pub fn new_birthday_probability(n: u32) -> f64 {
    /*
    p = 365^n / (365 * 364 * ... * (365-n+1)) => p = 365^(n-1) / (364 * 363 * ... * (365-n+1))
     */
    let total_possibilities: f64 = 365f64.powi((n-1) as i32); 
    let no_collision_possibilities: f64 = (2..=n).fold(1f64, |acc, i| { // acc从1开始
        acc * (365f64 - (i - 1) as f64) // 假设生日均匀分布，第1个人365天任意都可能，第2个人不能与前面的人相同，依次类推
    });
    let probability = 1f64 - (no_collision_possibilities / total_possibilities);

    (probability * 10000f64).round() / 10000f64 // 保留四位有效数字
}
